home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
science
/
sm32a.zip
/
SYMBMATH.H14
< prev
next >
Wrap
Text File
|
1993-11-07
|
654b
|
15 lines
3.3.4 Conditional
There are two conditional functions:
if(test then x)
if(test then x else y)
if(condition then x) gives x if condition evaluates to 1, or no
output otherwise.
if(condition then x else y) gives x if condition evaluates to 1, y if
it evaluates to 0, or no output if it
evaluates to neither 1 or 0.
The 2 words (then and else) can be replaced by comma ,.
It is useful in definition of the use-defined function to left the
function unevaluted if the argument of the function is not number.
e.g. define f(x_):=if(isnumber(x), 1), then call f(x), f(10) gives 1,
and f(a) gives f(a).